<%@ taglib prefix="atguigu" uri="http://www.atguigu.com/foreach/core" %>
<%@ page import="com.webtest.javabeantest.Customer" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%--
  Created by IntelliJ IDEA.
  User: lzy
  Date: 2018/8/13
  Time: 11:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Customers</title>
</head>
<body>
<%
    List<Customer> customers = new ArrayList<>();
    customers.add(new Customer(1, "xiaowang", 16));
    customers.add(new Customer(2, "xiaodong", 17));
    customers.add(new Customer(3, "xiaoli", 14));
    customers.add(new Customer(4, "jone", 19));
    customers.add(new Customer(5, "lili", 26));
    request.setAttribute("customers", customers);
%>
<atguigu:forEach items="${requestScope.customers}" var="cust">
    ${pageScope.cust.id} -- ${cust.name} -- ${cust.age} <br/>
</atguigu:forEach>
</body>
</html>
